﻿@using Entities
@model Entities.BOT
@section Title{@Model.BotName}
@section PageName{@WebUI.Resources.Details}
<div class="box">
    <h3>@Model.BotDescription</h3>
    <div class="brk">
    </div>
    <p>
        <b>Start Period: </b>@Model.StartPeriod</p>
    <div class="brk">
    </div>
    @if (@Model.EndPeriod.HasValue)
    {
        <p>
            <b>End Period: </b>@Model.EndPeriod.Value</p>
        <div class="brk">
        </div>
    }
    @if (Model.UnusualTrainingSpan.HasValue)
    {
        <b>Unusual Training Value</b><p>@Model.UnusualTrainingValue</p>
        <div class="brk">
        </div>
        <b>Unusual Training Span</b><p>
            @(Html.EnumText<TimeSpans>(Model.UnusualTrainingSpan.Value))
        </p>
        <div class="brk">
        </div>
    }
    <b>Min number of operations</b><p>@Model.MinOpsCount</p>
    <div class="brk">
    </div>
    <b>Min file size</b><p>@Model.MinFileSize</p>
    <div class="brk">
    </div>
    <b>Path</b><p>@Model.Path</p>
    <div class="brk">
    </div>
    <b>File Directory Name</b><p>@Model.FileDirectoryName</p>
    <div class="brk">
    </div>
    <b>Extension</b><p>@Model.FileExtension</p>
    <div class="brk">
    </div>
    @{if (Model.AllOps)
      {
        <b>All operations</b>
      }
      else
      {
        <b>Operations</b>
          foreach (BotsOperation botsOperation in Model.BotsOperations)
          {
        <p>@botsOperation.Operation.OperationName</p>
          }
      }
    }
    <div class="brk">
    </div>
    @{if (Model.AllHours)
      {
        <b>All hours</b>
      }
      else
      {
        <b>Hours</b>
          foreach (BotPeriodHour hour in Model.BotPeriodHours)
          {
        <p>@hour.Hour</p>
          }

      }
    }
    <div class="brk">
    </div>
    <p>
        <b>Bot notification type: </b>@(Html.EnumText<BotNotification>((int)Model.BotNotificationType))</p>
    <div class="brk">
    </div>
    <p>
        <b>Bot type: </b>@(Html.EnumText<BotType>((int)Model.BotType))</p>
    <div class="brk">
    </div>
    <p>
        <b>Bot type activity: </b>@Model.BotTypeActivity</p>
    <div class="brk">
    </div>
    @{if (Model.AllUsers)
      {
        <b>All users</b>
      }
      else
      {
        <b>users</b>      
          foreach (var user in Model.BotsUsers)
          {
        <p>@user.UserName</p>
          }
      }
    }
    <div class="brk">
    </div>
    @{
        if (Model.AllMachines)
        {
        <b>All machines</b>
        }
        else
        {
        <b>machines</b>
            foreach (var machine in Model.BotsMachines)
            {
        <p>@machine.MachineName</p>
            }
        }
    }
    <div class="brk">
    </div>
    <p>
        <b>Recurring every: </b>@Model.RecurringValue @(Html.EnumText<TimeSpans>((int)Model.RecurringSpan))</p>
    <div class="brk">
    </div>
    @Html.ActionLink(WebUI.Resources.Edit, MVC.Bots.Index.Edit(Model.BotId), new { @class = " btn" })
    <div class="brk">
    </div>
    @Html.ActionLink(WebUI.Resources.BacktoList, MVC.Bots.Index.Index(), new { @class = " btn" })
</div>
